"""
Tools for tag management

/file pkTagManager.py
/author Guillaume
/date december 2nd, 2012
"""

import unittest


class pkTagManager():
	""" Tag Mutator """

	def __init__(self, path):

		self.file_path = path


	def get_song_info(self):
		"""
		Get song informations in an array
		/note Array form: [title, artist, album, playtime, filepath]
		"""

		file_name = self._get_file_name()
		metadata = [(file_name, self.file_path)]

		return metadata


	def _get_file_name(self):
		""" Get the name of the file """

		index = self.file_path.rfind("/")
		file_name = self.file_path[index + 1:]

		return file_name


class TestTagManager(unittest.TestCase):

	def test_get_song_info(self):
		song_path = "../testSongs/test.mp3"
		song_name = "test.mp3"
		tagManager = pkTagManager(song_path)

		result_info = tagManager.get_song_info()
		expected_info = [song_name, song_path]
		self.assertEqual(result_info, expected_info)



if __name__ == "__main__":
	unittest.main()
